package com.jack.payment.util.serializer;


import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.jack.payment.util.common.StringUtil;

import java.io.IOException;

public class IsSettingSerializer extends JsonSerializer<String> {

    @Override
    public void serialize(String s, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
        if (!StringUtil.isEmpty(s)) {
            jsonGenerator.writeObject("******");
        } else {
            jsonGenerator.writeObject(s);
        }
    }
}
